﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClientDataAccess;
using System.Net.Mail;

namespace CustomControls
{
    public partial class PasswordForgottenForm : Form
    {
        public PasswordForgottenForm()
        {
            InitializeComponent();
        }

        public event EventHandler onSend;

        public string Address { get { return mailField.Text; } }
        public string Login { get { return nameField.Text; } }

        private void button1_Click(object sender, EventArgs e)
        {
            ClientSessionHandler handler = new ClientSessionHandler();

            handler.ChangePassword(this.nameField.Text, new MailAddress(this.mailField.Text));

            onSend.Invoke(this, e);
        }
    }
}
